<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>绘制半圆</title>
</head>
<body>
<canvas id="canvas" width="500px" height="500px"></canvas>
<script>

    var Utils = {
        /**弧度转换度*/
        computeRadians: function (degress) {
            return (Math.PI / 180) * degress;
        }
    };
    //获取画布DOM对象
    var canvas = document.getElementById('canvas');
    ctx = canvas.getContext('2d');
    ctx.beginPath();
    //ctx.arc() 参数说明
    //200 =x坐标，300 = y坐标，100 = radius
    // Utils.computeRadians(0) = startAngle
    // Utils.computeRadians(360)=endAngle
    //true = anticlockwise
    ctx.arc(200, 300, 100, Utils.computeRadians(0), Utils.computeRadians(360), true);
   ctx.closePath();
    ctx.stroke();


</script>
</body>
</html>
